package tests;

import helpers.TaskManagerFactory;
import junit.framework.TestCase;
import org.junit.Test;
import helpers.Configuration;

/**
 * Unit test for the task manager factory
 *
 * @author psyomn
 */
public class TaskManagerFactoryTest extends TestCase
{
    @Test
    public void testFactoryState() throws Exception
    {
        String att = Configuration.getAttribute("factory");

        if (att.equals("production"))
        {
            assertTrue
            (
                    TaskManagerFactory
                    .getInst()
                    .getNewTaskManager()
                    .getTasks()
                    .isEmpty()
            );
        }
        else if (att.equals("mock"))
        {
            assertTrue
            (
                    !TaskManagerFactory
                    .getInst()
                    .getNewTaskManager()
                    .getTasks()
                    .isEmpty()
            );
        }
    }
}
